package com.job.yangshida.homework11and12.homework0711;

import java.util.Objects;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-12 13:25:42
 */
public class Cup {
    private String name;
    private Double price;
    private Double capacity;
    private String color;

    public Cup(String name, Double price, Double capacity, String color) {
        this.name = name;
        this.price = price;
        this.capacity = capacity;
        this.color = color;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cup cup = (Cup) o;
        return Objects.equals(name, cup.name) &&
                Objects.equals(price, cup.price) &&
                Objects.equals(capacity, cup.capacity) &&
                Objects.equals(color, cup.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, price, capacity, color);
    }

    @Override
    public String toString() {
        return "Cup{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", capacity=" + capacity +
                ", color='" + color + '\'' +
                '}';
    }
}
